<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>JS的代码放的位置</title>
  </head>
  <style>
    .div {
      width: 100px;
      height: 100px;
      background-color: pink;
      transition: width 1s linear 0s, height 1s linear, background-color 1s linear 0s;
    }
  </style>

  <!-- <script>
    var div = document.querySelector(".div");
    div.onclick = function () {
      div.style.width = 300 + "px";
      div.style.height = 300 + "px";
      div.style.backgroundColor = "red"
    }
  </script> -->

  <body>
    <div class="div">div元素</div>
  </body>
  <script>
    /* 
    注释：
      1.单行注释：//
      2.多行注释:/*  */
    /* 3.文档注释：
     */
    var div = document.querySelector(".div");
    div.onclick = function () {
      div.style.width = 300 + "px";
      div.style.height = 300 + "px";
      div.style.backgroundColor = "red"
    }

    /**
     * 这是一个文档注释
     * 
     */
    function sum(a, b) {
      return a + b;
    }
    sum(1, 2);
  </script>

</html>